<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Pragma" content="no-cache">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, minimal-ui" />
<meta name="format-detection" content="telephone=no" />
<title>订单详情</title>
<meta content="" name="keywords" />
<meta content="" name="description" />
<meta content="" name="copyright" />
<meta content="" name="author" />
<meta name="robots" content="noarchive">
<script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="js/mescroll.min.js"></script>
<script type="text/javascript" src="layer/layer.js"></script>
<script type="text/javascript" src="js/urlTool.js"></script>
<link rel="stylesheet" href="css/public.css" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/mescroll.min.css">
<link rel="stylesheet" href="css/swiper.min.css" />
</head>

<body class="bgf8">
<div id="mescroll" class="mescroll pb120">
    <!--头部-->
    <div class="return_top bgyellow">
        <a href="ordercar.html">
            <span class="login_home cfff">返回订单列表</span>
        </a>
    </div>
    <!--//头部结束-->
    
    <div class="bgfff">
        <div class="p20 c999 clear bb">
            <div class="fl">订单号：<span id="orderNo"></span></div>
            <div class="fr" id="orderStatus"></div>
        </div>
        <div class="p20 c999 clear bb">
            <div class="clear">
                <div class="fl">商品名称：</div>
                <div class="fr" id="proName"></div>
            </div>
            <div class="clear">
                <div class="fl">订单类别：</div>
                <div class="fr" id="orderType"></div>
            </div>
        </div>        
        <div class="p20 c999 clear bb">
            <div class="clear">
                <div class="fl">购买数量：</div>
                <div class="fr" id="proNum"></div>
            </div>
            <div class="clear">
                <div class="fl">单价：</div>
                <div class="fr" id="proPrice"></div>
            </div>
            <div class="clear discountPrice">
                <div class="fl">优惠价：</div>
                <div class="fr" id="discountPrice"></div>
            </div>
        </div>    
        <div class="p20 c999 clear bb">
            <div class="clear">
                <div class="fl">创建时间：</div>
                <div class="fr" id="addTime"></div>
            </div>
            <div class="clear">
                <div class="fl">使用时间：</div>
                <div class="fr" id="useDay"></div>
            </div>
        </div>
    </div>

    <div class="clear hide">
        <div class="fl">支付价：</div>
        <div class="fr" id="orderPrice"></div>
    </div>

    <div class="car_cont hide">
        <button type="button" class="w100 car_cont_submit fz32 cfff">去付款</button>
    </div>
    
</div>
<!--底部-->
<div class="footerpage"></div>
<!--//底部-->
</body>
<script src="js/zepto.min.js"></script>
<script src="js/swiper.min.js"></script>
<script>
$(".footerpage").load("footer.html",'',function() {    
    $('#order').addClass("select-two").children().attr("class","orderclick");
});

var orderNo= getQueryVariable("orderNo");
var orderPrice='';
var orderStatus='';
$(function(){
    sm.req({
        url: '/sysOrder/getOrder',
        dataType:'json',
        type:'post',
        data: {orderNo:orderNo},
        done: function (res){
            if(res.code==200){
                $("#proName").html(res.data.sysOrder.proName);
                $("#proNum").html(res.data.sysOrder.proNum);
                $("#orderNo").html(res.data.sysOrder.orderNo);
                $("#addTime").html(res.data.sysOrder.addTime);
                $("#useDay").html(res.data.sysOrder.useDay);
                $("#orderStatus").html(res.data.sysOrder.orderStatus=='0' ? '未付款' : (res.data.sysOrder.orderStatus== '1' ? '已经付款' : '关闭交易'));
                if(res.data.sysOrder.orderStatus=='0'){
                    $(".car_cont").removeClass("hide");
                }
                $("#orderType").html(res.data.sysOrder.orderType== '0' ? '商品订单' : '车主卡订单');
                $("#proPrice").html(((res.data.sysOrder.proPrice)*0.01).toFixed(2));
                $("#discountPrice").html(((res.data.sysOrder.discountPrice)*0.01).toFixed(2));
                if(res.data.sysOrder.discountPrice=="" || res.data.sysOrder.discountPrice == undefined || res.data.sysOrder.discountPrice == null){
                    $(".discountPrice").addClass("hide");
                }
                $("#orderPrice").html(((res.data.sysOrder.orderPrice)*0.01).toFixed(2));
                orderPrice = res.data.sysOrder.orderPrice;
            }
            return false;                
        }
    })
})
$(".car_cont_submit").click(function(){ 
    location.href="orderbuy.html?orderNo="+orderNo+"&orderPrice="+orderPrice+""
})
</script>
</html>